<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">

    <title>信息照片上传</title>

    <link rel="stylesheet" type="text/css" href="/push/upload/css/base.css">
    <link rel="stylesheet" type="text/css" href="/push/upload/css/home.css">

</head>
<body>
<section class="aui-content">
    <div style="height:20px;"></div>
    <div class="aui-content-up">
        <form action="/user/elect" name="form1" id="form1" method="post">
            <div class="aui-content-up-form">
                <h2>成为内推人</h2>
            </div>
            <div class="aui-form-group clear">
                <input type="hidden" value="#(electMan.id??)" name="eleId">
                <label class="aui-label-control">
                    姓名 <em>*</em>
                </label>
                <div class="aui-form-input">
                    <input type="text" class="aui-form-control-two" name="yourname" value="#(electMan.name??)"
                           onBlur="checkna()" required id="1"
                           placeholder="请输入身份证名字">
                    <span class="tips" id="divname">长度1~6个字符</span>
                </div>
            </div>
            <div class="aui-form-group clear">
                <label class="aui-label-control">
                    手机号码 <em>*</em>
                </label>
                <div class="aui-form-input">
                    <input type="text" class="aui-form-control-two" name="yourphone" value="#(electMan.phone??)" id="2"
                           placeholder="请输入11位的手机号码"
                           onBlur="checkpsd1()" required/>
                    <span class="tips" id="phone">必须是11位的数字</span>
                </div>
            </div>
            <div class="aui-form-group clear">
                <label class="aui-label-control">
                    身份证号码 <em>*</em>
                </label>
                <div class="aui-form-input">
                    <input type="text" class="aui-form-control-two" name="youziz" value="#(electMan.get('idCard')??)" id="3"
                           placeholder=""
                           onBlur="checkpsd2()" required/>
                    <span class="tips" id="zizhi">必须是18位身份证号码</span>
                </div>
            </div>
            <div class="aui-form-group clear">
                <label class="aui-label-control">
                    个人介绍
                </label>
                <div class="aui-form-input">
                    <textarea class="aui-form-control" name="description" id="4" minlength="5">#(electMan.description??'请介绍一下你自己...')</textarea>
                </div>
            </div>
            <div class="aui-form-group clear">
                <label class="aui-label-control">
                    上传证件 <em>*</em>
                    <span>小于5M</span>
                </label>
                <div class="aui-form-input">
                    <div class="aui-content-img-box aui-content-full">
                        <div class="aui-photo aui-up-img clear">
                            <section class="aui-file-up fl">
                                <img src="#(electMan.image??)" class="add-img">
                            </section>
                            <section class="aui-file-up fl">
                                <img src="/push/upload/img/up.png" class="add-img">
                                <input type="file" name="file" id="file" class="file" value=""
                                       accept="image/jpg,image/jpeg,image/png,image/bmp" multiple/>
                            </section>
                        </div>
                    </div>
                </div>
            </div>
            <div class="aui-form-group-text">
                <h3>需要以下材料</h3>
                <p>身份证正反面照片及毕业证书缺一不可成为内推人</p>
            </div>
        </form>
    </div>
    <div class="aui-btn-default">
        <button class="aui-btn aui-btn-account" id="sub_btn">保存并提交审核</button>
        <button class="aui-btn aui-btn-account" id="index_btn">返回主页</button>
        #if(electMan.id??)
        <button class="aui-btn aui-btn-account" id="send_message">发布信息</button>
        #end
    </div>
</section>
<!-- mask begin -->
<div class="aui-mask aui-works-mask">
    <div class="aui-mask-content">
        <p class="aui-delete-text">确定要删除你上传的资料？</p>
        <p class="aui-check-text">
            <span class="aui-delete aui-accept-ok">确定</span>
            <span class="aui-accept-no">取消</span>
        </p>
    </div>
</div>
<!-- mask end -->
<script type="text/javascript" src="/push/upload/js/jquery.min.js"></script>
<script type="text/javascript" src="/push/upload/js/up.js"></script>
<script type="text/javascript">
    $(function () {
        $('#sub_btn').click(function () {
            var o = $('#1').val();
            var o1 = $('#2').val();
            var o2 = $('#3').val();
            var o3 = $('#4').val();
            if (o == "" || o1 == "" || o2 == "" || o3 == "" || o == null || o1 == null || o2 == null || o3 == null) {
                alert("请检查输入是否正确！")
            } else {
                $("#form1").submit();
            }
        });
        $('#index_btn').click(function () {
            window.location.href = '/push';
        })

        $('#send_message').click(function () {
            window.location.href='/push/companyPage?eleId=#(electMan.id??)'
        })
    })

    //验证姓名
    function checkna() {
        na = form1.yourname.value;
        if (na.length < 1 || na.length > 6) {
            divname.innerHTML = '<font class="tips_false">长度是1~6个字符</font>';
        } else {
            divname.innerHTML = '<font class="tips_true">输入正确</font>';
        }
    }

    //验证手机号码
    function checkpsd1() {
        na = form1.yourphone.value;
        if (na.length < 11 || na.length > 11) {
            phone.innerHTML = '<font class="tips_false">必须是11位的数字</font>';
        } else {
            phone.innerHTML = '<font class="tips_true">输入正确</font>';
        }
    }

    //验证社会统一代码
    function checkpsd2() {
        na = form1.youziz.value;
        if (na.length < 18 || na.length > 18) {
            zizhi.innerHTML = '<font class="tips_false">必须是18身份证号码</font>';
        } else {
            zizhi.innerHTML = '<font class="tips_true">输入正确</font>';
        }
    }
</script>
</body>
</html>
